﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="AddNewSpendItem.aspx.cs" Inherits="masterPages_spend_AddNewSpendItem" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <script type="text/javascript">
        function OnClearBtnClick() {
            document.getElementById("SpendItemNameTextBox").value = "";
            document.getElementById("ItemPriceTextBox").value = "";
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
        <asp:ObjectDataSource ID="SourceSpendType" runat="server" 
            DataObjectTypeName="SpendTypeDetail" DeleteMethod="DeleteEmployees" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetEmployees" 
            TypeName="SpendTypeDB" UpdateMethod="UpdateEmployees"></asp:ObjectDataSource>
        <table width="730" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="34" style="background-image:../../images/bj2.gif"><strong>&nbsp;&nbsp;&nbsp;&nbsp;项目添加</strong></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>
                <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            <table width="577" border="1" align="center" cellpadding="5" style="background-color:#999999">
                                <tr>
                                    <td align="center">消费项目名称：</td>
                                    <td><asp:TextBox ID="SpendItemNameTextBox" ClientIDMode="Static" runat="server" />
                                        <asp:RequiredFieldValidator ID="NameRequiredFieldValidator" runat="server" 
                                            ControlToValidate="SpendItemNameTextBox" ErrorMessage="RequiredFieldValidator" 
                                            ForeColor="Red">项目名称不能为空</asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">消费项目价格：</td>
                                    <td><asp:TextBox ID="ItemPriceTextBox" ClientIDMode="Static" runat="server" />
                                        <asp:RegularExpressionValidator ID="PriceRegularExpressionValidator" 
                                            runat="server" ErrorMessage="RegularExpressionValidator" 
                                            ForeColor="Red" ValidationExpression="\d+\.?[\d]{0,2}" 
                                            ControlToValidate="ItemPriceTextBox">消费项目价格不是正确的格式</asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">消费项目类型：</td>
                                    <td>
                                        <asp:DropDownList ID="SpendTypeDropDownList" runat="server" 
                                            DataSourceID="SourceSpendType" DataTextField="SpendTypeName" 
                                            DataValueField="SpendTypeId" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/an11.gif" onclick="AddImageButton_Click" />
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/an3.gif" OnClientClick="OnClearBtnClick();return false;" />
                        </td>
                    </tr>
                </table>
            </td>
          </tr>
        </table>
</asp:Content>

